---
title: Gestures
sidebar_position: 13
---

import { Niivue } from '@niivue/niivue';
import { GestureDemo } from '../src/components/GestureDemo';
import { NiivueBrowserWrapper } from '../src/components/NiivueBrowserWrapper';

NiiVue supports a wide range of interactive gestures for image manipulation using input devices such as a mouse, touchscreen, or stylus. Some gestures are input-specific—for example, pinch-to-zoom on touchscreens or scroll wheel zoom with a mouse. Gesture behaviors are also configurable to suit different tasks. By default, the primary drag gesture (typically left-click and drag) adjusts image contrast, while the secondary drag gesture (usually right-click and drag) selects a region to automatically optimize contrast. The primary drag can also be configured to control the colormap window (i.e., brightness and contrast). The secondary drag is customizable as well—it can be set to pan the image, zoom, measure distances, or be disabled entirely. Developers can also define custom drag behavior by assigning a callback function, as demonstrated in the [drag callback live demo](https://niivue.com/demos/features/dragCallback.html).

<NiivueBrowserWrapper>
  <GestureDemo />
</NiivueBrowserWrapper>
